<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <!-- 全屏 -->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 上方栏显示 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 不自动识别号码 -->
    <meta name="format-detection" content="telephone=no">
    <!-- Include js plugin -->
    <title>设置-学员中心</title>
    <script src="/static/wap/weui/js/jquery.min.js"></script>
    <link rel="stylesheet" href="/static/wap/skin/css/layout.css">
    <link rel="stylesheet" href="/static/wap/skin/css/demos.css">
	  <link rel="stylesheet" href="/static/wap/weui/css/weui.min.css">
    <link rel="stylesheet" href="/static/wap/weui/css/jquery-weui.min.css">
    <style>
       select {
            /*Chrome和Firefox里面的边框是不一样的，所以复写了一下*/
            border: solid 1px #000;
            /*很关键：将默认的select选择框样式清除*/
            appearance:none;
            -moz-appearance:none;
            -webkit-appearance:none;
            /*将背景改为绿色*/
            border:0;
            /*留出一点位置，避免被文字覆盖*/
            padding-right: 14px;
        }
        /*清除ie的默认选择框样式清除，隐藏下拉箭头*/
        select::-ms-expand { display: none; }
    </style>
</head>
<body>

<header class="brB">
  <div class="h_top">
      <div class="hLeft"><a href="/my/home" class="icoH icoReturn mt20"></a></div>
      <div class="hCenter"><span class="tit c-3ac9af">设置</span></div>
    </div>
</header>
<div class="warp">
    <div class="weui-cells">
      <a class="weui-cell weui-cell_access" href="javascript:;">
        <div class="weui-cell__bd">
          <p>头像</p>
        </div>
        <div class="weui-cell__ft">
          <span class="ith_img mt10" style="width:2rem;height:2rem;background-image:url(<{if !empty($user_info.head_image_url)}><{$user_info.head_image_url}><{else}>/static/wap/skin/temp/200200.png<{/if}>);"></span>
        </div>
      </a>
      <a class="weui-cell weui-cell_access" href="javascript:;">
        <div class="weui-cell__bd">
          <p>昵称</p>
        </div>
        <div class="weui-cell__ft"><input class="user_info" name="nick" type="text" value="<{$user_info.nick}>" style="border:0; text-align: right;" onclick="javascript:this.select()">
        </div>
      </a>
      <a class="weui-cell weui-cell_access" href="javascript:;">
        <div class="weui-cell__bd">
          <p>手机</p>
        </div>
        <div class="weui-cell__ft">
          <span><{$user_info.mobile}></span>
        </div>
      </a>
      <a class="weui-cell weui-cell_access" href="javascript:;">
        <div class="weui-cell__bd">
          <p>微信号</p>
        </div>
        <div class="weui-cell__ft">
          <span><{$user_info.open_id}></span>
        </div>
      </a>
    </div>
    <div class="weui-cells">
      <a class="weui-cell weui-cell_access" href="javascript:;">
        <div class="weui-cell__bd">
          <p>性别</p>
        </div>
        <div class="weui-cell__ft">
          <span>
          <select name="sex" class="user_info">
            <option <{if $user_info.sex == 0}>selected<{/if}> value="0">女</option>
            <option <{if $user_info.sex == 1}>selected<{/if}> value="1">男</option>
          </select>
          </span>
        </div>
      </a>
      
    </div>
    <div class="weui-cells">
      <a class="weui-cell weui-cell_access" href="/logreg/logout">
        <div class="weui-cell__bd">
          <p>退出登录</p>
        </div>
        <div class="weui-cell__ft">
        </div>
      </a>
    </div>
</div>

<script>
  $(function(){
    $(".user_info").change(function(){
      var name = $(this).attr("name");
      var value = $(this).val();
      if(name == "sex"){
        var data = {'sex':value};
      }else{
        var data = {'nick':value};
      }

      $.ajax({
          type: "POST",
          url: "/my/user/update_user_info",
          dataType:"json",
          data:data,
          success: function(result){
            
          }
      })
    })
  })
</script>
</body>
</html>